home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.internetmci.com!xmission!news
- From: tknarr@xmission.com ( Todd Knarr )
- Newsgroups: comp.lang.c++
- Subject: Re: two tricky questions
- Date: 7 Jan 1996 02:21:20 GMT
- Organization: Chaos Central
- Message-ID: <4cnan0$gqv@news.xmission.com>
- References: <4c6v9u$jdl@news.xmission.com> <DKLzyq.M1u@cix.compulink.co.uk>
- Reply-To: tknarr@xmission.com ( Todd Knarr )
- NNTP-Posting-Host: slc112.xmission.com
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <DKLzyq.M1u@cix.compulink.co.uk>, henri@cix.compulink.co.uk ("Henry Andrew") writes:
- >sorry to be a pedant but C++ does not do a bitwise copy is a default copy
- >ctor. It does a memberwise copy.
-
- Sorry to be a pedant back, but the grey book specifically mentions bitwise
- copies. Think about how the copy ctor for a class needs to work for two
- cases:
-
- 1) the class contains members of a class without a copy ctor or copy
- assignment.
- 2) the class contains an array.
-
- The specific sequence is that the generated copy ctor uses memberwise copy
- for all members which have copy assignment or the copy ctor ( depending on
- circumstances ) defined, and bitwise copy for members that do not.
-
- --
- Todd Knarr : tknarr@xmission.com | finger for PGP public key
- | Member, USENET Cabal
-
- Seriously, I don't want to die just yet. I don't care how
- good-looking they are, I! don't! want! to! die!"
- -- Megazone ( UF1 )
-
-